/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Grabacion;
/**
 *
 * @author Jhon Jairo
 */
import Vista.configuracion.NameVideo;
import java.io.File;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.TargetDataLine;

public class RecAudioOnly {
    static AudioFileFormat.Type aFF_T = AudioFileFormat.Type.WAVE;
    static AudioFormat aF = new AudioFormat(44100, 16, 2, true, false);
    public static TargetDataLine tD1;
    public static File f;

    public RecAudioOnly() {
        try {
            
            DataLine.Info dLI = new DataLine.Info(TargetDataLine.class, aF);
            tD1 = (TargetDataLine) AudioSystem.getLine(dLI);
            new CapThread().start();
        } catch (Exception e) {
        }
    }

    public static class CapThread extends Thread {
        public void run() {
            try {
                tD1.open(aF);
                tD1.start();
                AudioSystem.write(new AudioInputStream(tD1), aFF_T, f);
            } catch (Exception e) {
            }
        }
    }
}
